﻿Imports System.Windows.Forms

Public Class frmMdiMain

    Private m_ChildFormNumber As Integer
    Private mCurrentUserLedger As ClsUserLedger
    Private mCurrentLedgerSetting As ClsTLedgerSetting '当前指定的操作账套参数

    Private Sub frmMdiMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim frmLogin As New frmLogin
        Dim tmpList As List(Of ClsUserLedger) = Nothing
        Dim tmpUserLedgerDbAccess As ClsUserLedgerDbAccess = Nothing  'New clsUserLedgerDbAccess(appInfoConnectionString)
        '隐藏自身
        Me.Hide()
        '打开登录窗体
        If frmLogin.ShowDialog() = DialogResult.OK Then
            '登录窗体退出
            '正常进入系统，即选择了账套，
            Me.Show()
            '取出当前用户的账套权限信息
            tmpUserLedgerDbAccess = New ClsUserLedgerDbAccess(sysAppInfoConnectionString)
            tmpList = tmpUserLedgerDbAccess.GetUserLederByUserIdAndLedgerId(sysCurrentClsUser.UserId, sysCurrentClsLedger.LedgerId)
            '保存当前用户权限到窗体变量
            mCurrentUserLedger = tmpList.Item(0)
            '指定状态栏内容
            CheckStatus()
            '取出当前用户指定的账套参数信息
            OpenCurrentTLedgerSetting()
            '准备菜单显隐
            CheckMainMenu()
            '准备导航窗体
            OpenNavigateForm()

            ''如果当前操作账套未启用，则显示启用窗体
            If sysCurrentLedgerSetting IsNot Nothing AndAlso Not sysCurrentLedgerSetting.LedgerIfOpened Then
                Dim tmpOpenForm As frmFinancialSetupGlobalPrint = New frmFinancialSetupGlobalPrint()
                tmpOpenForm.ShowDialog()
            End If
        Else
            '没有账套可以选择，
            Me.Show()

            '指定状态栏内容
            CheckStatus()

            '准备菜单显隐
            CheckMainMenu()
            '准备导航窗体
            OpenNavigateForm()
        End If



    End Sub

    Private Sub OpenCurrentTLedgerSetting()
        Try

            '判断当前是否选择了账套
            If sysCurrentClsLedger Is Nothing Then
                Exit Sub
            End If

            Dim tmpDbAccess As ClsTLedgerSettingDbAccess = New ClsTLedgerSettingDbAccess(sysUserDataConnectionString)
            '将当前账套参数保存到全局变量
            sysCurrentLedgerSetting = tmpDbAccess.GetLedgerSetting()

            If sysCurrentLedgerSetting Is Nothing Then
                '当前没有指定的账套
                Me.tssLblOpened.Text = ""
                Me.tssLblWorkYear.Text = ""
            Else
                If sysCurrentLedgerSetting.LedgerIfOpened Then
                    '已启用，则显示启用日期和当前会计期间
                    Me.tssLblOpened.Text = "启用日期：" & sysCurrentLedgerSetting.LedgerOpenedDate.ToShortDateString
                    Me.tssLblWorkYear.Text = "当前会计期间：" & sysCurrentLedgerSetting.LedgerWorkYear
                Else
                    '指定了账套，但未启用
                    Me.tssLblOpened.Text = "账套未启用"
                    Me.tssLblWorkYear.Text = ""
                End If
            End If

        Catch ex As OleDb.OleDbException
            '收集错误信息
            mErrorNumber = ex.ErrorCode
            mErrorMessage = ex.Message
            mErrorCreater = "frmMdiMain - OpenCurrentTLedgerSetting"
        End Try

    End Sub


    Private Sub CheckStatus()
        '如果指定了当前操作的账套
        If sysCurrentClsLedger IsNot Nothing Then
            Me.tssLblCompany.Text = sysCurrentClsLedger.LedgerCompanyName & " : " & sysCurrentClsLedger.LedgerName
        Else
            Me.tssLblCompany.Visible = False
        End If

        '当前登录用户
        Me.tssLblUser.Text = sysCurrentClsUser.UserName
        If sysCurrentClsUser.UserIfAdmin Then
            Me.tssLblUser.Text &= "(管理员)"
        End If

    End Sub

    Private Sub CheckMainMenu()
        If sysCurrentClsLedger Is Nothing Then
            '当前登录的管理员没有可管理的账套
            Me.VoucherMenu.Visible = False
            Me.ReportMenu.Visible = False
            Me.LedgerMenu.Visible = False
            Me.SysSetupMenu.Visible = False
            Me.FinancialSetupMenu.Visible = False
            Me.mainMenuItemAcctConvert.Enabled = False '科目转换工具
            Me.mainMenuItemInitialize.Enabled = False '初始设置
            Me.mainMenuItemClearLedger.Enabled = False '清空总账
        Else
            '有账套，查看是否有管理权限
            '当下版本权限 管理采用最简单的方法，即，只管理一件事：账套 用户 和 初始设置
            If Not sysCurrentClsUser.UserIfAdmin Then
                Me.SysManageMenu.Visible = False
            End If
        End If
    End Sub

    Private Sub OpenNavigateForm()
        '测试导航窗体
        Dim frmNav = New frmNavigate

        '取出可改变宽度的窗体边框的宽及高(双边的都包括)
        Dim frmBorderWidth As Integer = GetSystemMetrics(SM_CXSIZEFRAME) 'SM_CXEDGE) 'SM_CXFRAME) 'GetSystemMetrics(SM_CXBORDER) 'Me.Width - Me.ClientSize.Width
        Dim frmBorderHeight As Integer = GetSystemMetrics(SM_CYSIZEFRAME) 'SM_CYFRAME) 'SM_CYBORDER) 'Me.Height - Me.ClientSize.Height

        frmNav.Anchor = AnchorStyles.Left Or AnchorStyles.Top
        frmNav.Width = FORM_NAVAGATE_BUTTON_WIDTH + frmBorderWidth * 2 + 6 '6 - 按钮左右margin

        frmNav.Height = Me.ClientSize.Height - Me.statusStripMainMdi.Height - Me.menuStripMainMdi.Height - frmBorderHeight
        frmNav.TopMost = True
        frmNav.MdiParent = Me

        frmNav.Show()

        sysAppFrmNavigateForm = frmNav

        Me.mainMenuItemNavForm.Checked = sysAppFrmNavigateForm.Visible
    End Sub

    Private Sub mainMenuItemNavForm_Click(sender As Object, e As EventArgs) Handles mainMenuItemNavForm.Click
        '导航窗格
        Dim ifVisible As Boolean

        If sysAppFrmNavigateForm IsNot Nothing Then


            ifVisible = Not sysAppFrmNavigateForm.Visible
            sysAppFrmNavigateForm.Visible = ifVisible

            Me.mainMenuItemNavForm.Checked = sysAppFrmNavigateForm.Visible
        Else
            OpenNavigateForm()
        End If

        Me.mainMenuItemNavForm.Checked = sysAppFrmNavigateForm.Visible

    End Sub

    Private Sub mainMenuItemExit_Click(sender As Object, e As EventArgs) Handles mainMenuItemExit.Click
        Me.Close()
    End Sub

    Private Sub OpenMenuFunction(ByVal funString As String)
        '创建并打开对应的窗体
        Try
            '取出按钮，判断是哪个按钮
            Dim tmpForm As Form = Nothing

            Select Case funString
                Case NAV_ITEM_INPUT_VOUCHER_TAG '01
                    tmpForm = GenericSingleton(Of FrmVoucherInput).CreateInstance()
                Case NAV_ITEM_EDIT_VOUCHER_TAG '02
                    tmpForm = GenericSingleton(Of frmVoucherEdit).CreateInstance()
                Case NAV_ITEM_CHECKUP_VOUCHER_TAG '03
                    tmpForm = GenericSingleton(Of frmVoucherCheckup).CreateInstance()
                Case NAV_ITEM_DELETE_VOUCHER_TAG '04
                    tmpForm = GenericSingleton(Of frmVoucherDelete).CreateInstance()
                Case NAV_ITEM_INPUTFROMRJCW_VOUCHER_TAG '05
                    tmpForm = GenericSingleton(Of frmVoucherInputFromRJCW).CreateInstance()
                Case NAV_ITEM_LOOKUP_VOUCHER_TAG '06
                    tmpForm = GenericSingleton(Of frmVoucherLookup).CreateInstance()
                Case NAV_ITEM_REPAIR_VOUCHER_TAG '07
                    tmpForm = GenericSingleton(Of frmVoucherRepair).CreateInstance()
                Case NAV_ITEM_BROWSE_VOUCHER_TAG '08
                    tmpForm = GenericSingleton(Of frmVoucherBrowse).CreateInstance()
                Case NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TAG '09
                    tmpForm = GenericSingleton(Of frmVoucherInputFromExcel).CreateInstance()
                Case NAV_ITEM_INPUTGENEXCEL_VOUCHER_TAG '10
                    tmpForm = GenericSingleton(Of frmVoucherGenFromExcel).CreateInstance()
                Case NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TAG '11
                    tmpForm = GenericSingleton(Of frmVoucherOutpuToExcel).CreateInstance()
                Case NAV_ITEM_POST_VOUCHER_TAG '01 
                    tmpForm = GenericSingleton(Of frmVoucherPost).CreateInstance()
                Case NAV_ITEM_SETTLEMONTH_LEDGER_TAG '02 
                    tmpForm = GenericSingleton(Of frmLedgerSettleMonth).CreateInstance()
                Case NAV_ITEM_UNPOST_LEDGER_TAG '03
                    tmpForm = GenericSingleton(Of frmLedgerUnPost).CreateInstance()
                Case NAV_ITEM_SUMACCOUNT_LEDGER_TAG '04
                    tmpForm = GenericSingleton(Of frmLedgerSumAccount).CreateInstance()
                Case NAV_ITEM_ACCOUNTBALANCE_LEDGER_TAG '05
                    tmpForm = GenericSingleton(Of frmLedgerAccountBalance).CreateInstance()
                Case NAV_ITEM_QUANTITYBALANCE_LEDGER_TAG '06
                    tmpForm = GenericSingleton(Of frmLedgerQuantityBalance).CreateInstance()
                Case NAV_ITEM_FAKEPOST_LEDGER_TAG '07
                    tmpForm = GenericSingleton(Of frmLedgerFakePost).CreateInstance()
                Case NAV_ITEM_INCANDDEC_LEDGER_TAG '08
                    tmpForm = GenericSingleton(Of frmLedgerIncAndDec).CreateInstance()
                Case NAV_ITEM_ACCTDETAIL_REPORT_TAG '01
                    tmpForm = GenericSingleton(Of frmReportAcctDetail).CreateInstance()
                Case NAV_ITEM_GENERALLEDGER_REPORT_TAG '02
                    tmpForm = GenericSingleton(Of frmReportGeneralLedger).CreateInstance()
                Case NAV_ITEM_FINANCIALSTATEMENT_REPORT_TAG '03
                    tmpForm = GenericSingleton(Of frmReportFinancialStatement).CreateInstance()
                Case NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG '04
                    tmpForm = GenericSingleton(Of frmReportDefineMultiColumn).CreateInstance()
                Case NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG '05
                    tmpForm = GenericSingleton(Of frmReportMultiColumn).CreateInstance()
                Case NAV_ITEM_COMBOCOLUMN_REPORT_TAG '06
                    tmpForm = GenericSingleton(Of frmReportComboColumn).CreateInstance()
                Case NAV_ITEM_ACCT_FINANCIALSETUP_TAG '01
                    tmpForm = GenericSingleton(Of frmFinancialSetupAcct).CreateInstance()
                Case NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TAG '02
                    tmpForm = GenericSingleton(Of frmFinancialSetupInputAcct).CreateInstance()
                Case NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TAG '03
                    tmpForm = GenericSingleton(Of frmFinancialSetupRepairAcct).CreateInstance()
                Case NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TAG '04
                    tmpForm = GenericSingleton(Of frmFinancialSetupSepcialProject).CreateInstance()
                Case NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TAG '05
                    tmpForm = GenericSingleton(Of frmFinancialSetupVoucherType).CreateInstance()
                Case NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TAG '06
                    tmpForm = GenericSingleton(Of frmFinancialSetupGlobalPrint).CreateInstance()
                Case NAV_ITEM_PRINT_SETUP_SYS_SETUP_TAG '01
                    tmpForm = GenericSingleton(Of frmSysSetupPrintSetup).CreateInstance()
                Case NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TAG '02
                    tmpForm = GenericSingleton(Of frmSysSetupBackupRestore).CreateInstance()
                Case NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TAG '03
                    tmpForm = GenericSingleton(Of frmSysSetupModifyPassword).CreateInstance()
                Case NAV_ITEM_CARRYOVER_SYS_SETUP_TAG '04
                    tmpForm = GenericSingleton(Of frmSysSetupCarryOver).CreateInstance()
                Case NAV_ITEM_HISTORY_DATA_SYS_SETUP_TAG '05
                    tmpForm = GenericSingleton(Of frmSysSetupHistoryData).CreateInstance()
                Case NAV_ITEM_CHANGE_USER_SYS_SETUP_TAG '06
                    tmpForm = GenericSingleton(Of frmSysSetupChangeUser).CreateInstance()
                Case NAV_ITEM_LEDGERS_SYS_MANAGE_TAG '01
                    tmpForm = GenericSingleton(Of frmSysManageLedgers).CreateInstance()
                Case NAV_ITEM_USERS_SYS_MANAGE_TAG '02
                    tmpForm = GenericSingleton(Of frmSysManageUsers).CreateInstance()
                Case NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TAG '03
                    tmpForm = GenericSingleton(Of frmSysManageAcctConvert).CreateInstance()
                Case NAV_ITEM_INITIALIZE_SYS_MANAGE_TAG '04
                    tmpForm = GenericSingleton(Of frmSysManageInitialize).CreateInstance()
                Case NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TAG '05
                    tmpForm = GenericSingleton(Of frmSysManageClearGeneralLedger).CreateInstance()
            End Select

            If tmpForm IsNot Nothing Then
                With tmpForm
                    .MdiParent = sysFrmMdiMain
                    .StartPosition = FormStartPosition.CenterScreen
                    .Show()
                End With
            End If

        Catch ex As Exception
            '收集错误信息
            mErrorNumber = ERROR_NUMBER_CONTROL
            mErrorMessage = ex.Message
            mErrorCreater = "frmMdiMain - OpenMenuFunction"
        End Try

    End Sub

    Private Sub mainMenuItemInputVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemInputVoucher.Click
        OpenMenuFunction(NAV_ITEM_INPUT_VOUCHER_TAG) '01
    End Sub

    Private Sub mainMenuItemModifyVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemModifyVoucher.Click
        OpenMenuFunction(NAV_ITEM_EDIT_VOUCHER_TAG) '02

    End Sub

    Private Sub mainMenuItemCheckupVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemCheckupVoucher.Click
        OpenMenuFunction(NAV_ITEM_CHECKUP_VOUCHER_TAG) '03

    End Sub

    Private Sub mainMenuItemDeleteVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemDeleteVoucher.Click
        OpenMenuFunction(NAV_ITEM_DELETE_VOUCHER_TAG) '04

    End Sub

    Private Sub mainMenuItemBrowseVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemBrowseVoucher.Click
        OpenMenuFunction(NAV_ITEM_BROWSE_VOUCHER_TAG) '08

    End Sub

    Private Sub mainMenuItemLookupVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemLookupVoucher.Click
        OpenMenuFunction(NAV_ITEM_LOOKUP_VOUCHER_TAG) '06

    End Sub

    Private Sub mainMenuItemRepairVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemRepairVoucher.Click
        OpenMenuFunction(NAV_ITEM_REPAIR_VOUCHER_TAG) '07

    End Sub

    Private Sub mainMenuItemInputVoucherFromRjcw_Click(sender As Object, e As EventArgs) Handles mainMenuItemInputVoucherFromRjcw.Click
        OpenMenuFunction(NAV_ITEM_INPUTFROMRJCW_VOUCHER_TAG) '05

    End Sub

    Private Sub mainMenuItemInputVoucherFromExcel_Click(sender As Object, e As EventArgs) Handles mainMenuItemInputVoucherFromExcel.Click
        OpenMenuFunction(NAV_ITEM_INPUTFROMEXCEL_VOUCHER_TAG) '09

    End Sub

    Private Sub mainMenuItemGenVoucherFromExcel_Click(sender As Object, e As EventArgs) Handles mainMenuItemGenVoucherFromExcel.Click
        OpenMenuFunction(NAV_ITEM_INPUTGENEXCEL_VOUCHER_TAG) '10

    End Sub

    Private Sub mainMenuItemOutpuVoucherToExcel_Click(sender As Object, e As EventArgs) Handles mainMenuItemOutpuVoucherToExcel.Click
        OpenMenuFunction(NAV_ITEM_OUTPUTTOEXCEL_VOUCHER_TAG) '11

    End Sub

    Private Sub mainMenuItemPostMonth_Click(sender As Object, e As EventArgs) Handles mainMenuItemPostMonth.Click
        OpenMenuFunction(NAV_ITEM_POST_VOUCHER_TAG) '01 

    End Sub

    Private Sub mainMenuItemSettleMonth_Click(sender As Object, e As EventArgs) 
        OpenMenuFunction(NAV_ITEM_SETTLEMONTH_LEDGER_TAG) '02 

    End Sub

    Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
        OpenMenuFunction(NAV_ITEM_UNPOST_LEDGER_TAG) '03

    End Sub

    Private Sub mainMenuItemSumAcct_Click(sender As Object, e As EventArgs) Handles mainMenuItemSumAcct.Click
        OpenMenuFunction(NAV_ITEM_SUMACCOUNT_LEDGER_TAG) '04

    End Sub

    Private Sub mainMenuItemAcctBalance_Click(sender As Object, e As EventArgs) Handles mainMenuItemAcctBalance.Click
        OpenMenuFunction(NAV_ITEM_ACCOUNTBALANCE_LEDGER_TAG) '05

    End Sub

    Private Sub mainMenuItemQuantityBalance_Click(sender As Object, e As EventArgs) Handles mainMenuItemQuantityBalance.Click
        OpenMenuFunction(NAV_ITEM_QUANTITYBALANCE_LEDGER_TAG) '06

    End Sub

    Private Sub mainMenuItemFakePostVoucher_Click(sender As Object, e As EventArgs) Handles mainMenuItemFakePostVoucher.Click
        OpenMenuFunction(NAV_ITEM_FAKEPOST_LEDGER_TAG) '07

    End Sub

    Private Sub mainMenuItemIncAndDec_Click(sender As Object, e As EventArgs) Handles mainMenuItemIncAndDec.Click
        OpenMenuFunction(NAV_ITEM_INCANDDEC_LEDGER_TAG) '08

    End Sub

    Private Sub mainMenuItemAcctDetail_Click(sender As Object, e As EventArgs) Handles mainMenuItemAcctDetail.Click
        OpenMenuFunction(NAV_ITEM_ACCTDETAIL_REPORT_TAG) '01

    End Sub

    Private Sub mainMenuItemGeneralLedger_Click(sender As Object, e As EventArgs) Handles mainMenuItemGeneralLedger.Click
        OpenMenuFunction(NAV_ITEM_GENERALLEDGER_REPORT_TAG) '02

    End Sub

    Private Sub mainMenuItemFinancialStatement_Click(sender As Object, e As EventArgs) Handles mainMenuItemFinancialStatement.Click
        OpenMenuFunction(NAV_ITEM_FINANCIALSTATEMENT_REPORT_TAG) '03

    End Sub

    Private Sub mainMenuItemDefineMultiColumn_Click(sender As Object, e As EventArgs) Handles mainMenuItemDefineMultiColumn.Click
        OpenMenuFunction(NAV_ITEM_DEFINEMULTICOLUMN_REPORT_TAG) '04

    End Sub

    Private Sub mainMenuItemMultiColumn_Click(sender As Object, e As EventArgs) Handles mainMenuItemMultiColumn.Click
        OpenMenuFunction(NAV_ITEM_MULTICOLUMN_REPORT_TAG) '05

    End Sub

    Private Sub mainMenuItemComboColumn_Click(sender As Object, e As EventArgs) Handles mainMenuItemComboColumn.Click
        OpenMenuFunction(NAV_ITEM_COMBOCOLUMN_REPORT_TAG) '06

    End Sub

    Private Sub mainMenuItemAcctSetup_Click(sender As Object, e As EventArgs) Handles mainMenuItemAcctSetup.Click
        OpenMenuFunction(NAV_ITEM_ACCT_FINANCIALSETUP_TAG) '01

    End Sub

    Private Sub mainMenuItemInputAcct_Click(sender As Object, e As EventArgs) Handles mainMenuItemInputAcct.Click
        OpenMenuFunction(NAV_ITEM_INPUT_ACCT_FINANCIALSETUP_TAG) '02

    End Sub

    Private Sub mainMenuItemRepairAcct_Click(sender As Object, e As EventArgs) Handles mainMenuItemRepairAcct.Click
        OpenMenuFunction(NAV_ITEM_REPAIR_ACCT_FINANCIALSETUP_TAG) '03

    End Sub

    Private Sub mainMenuItemAcctType_Click(sender As Object, e As EventArgs) Handles mainMenuItemAcctType.Click
        OpenMenuFunction(NAV_ITEM_VOUCHER_TYPE_FINANCIALSETUP_TAG) '05

    End Sub

    Private Sub mainMenuItemGlobalSetup_Click(sender As Object, e As EventArgs) Handles mainMenuItemGlobalSetup.Click

        OpenMenuFunction(NAV_ITEM_GLOBAL_PRINT_FINANCIALSETUP_TAG)
    End Sub

    Private Sub mainMenuItemEditPassword_Click(sender As Object, e As EventArgs) Handles mainMenuItemEditPassword.Click
        OpenMenuFunction(NAV_ITEM_MODIFY_PASSWORD_SYS_SETUP_TAG) '03

    End Sub

    Private Sub mainMenuBackupAndRestore_Click(sender As Object, e As EventArgs) Handles mainMenuBackupAndRestore.Click
        OpenMenuFunction(NAV_ITEM_BACKUP_RESTORE_SYS_SETUP_TAG) '02

    End Sub

    Private Sub mainMenuItemCarryOver_Click(sender As Object, e As EventArgs) Handles mainMenuItemCarryOver.Click
        OpenMenuFunction(NAV_ITEM_CARRYOVER_SYS_SETUP_TAG) '04

    End Sub

    Private Sub mainMenuItemHistoryData_Click(sender As Object, e As EventArgs) Handles mainMenuItemHistoryData.Click
        OpenMenuFunction(NAV_ITEM_HISTORY_DATA_SYS_SETUP_TAG) '05

    End Sub

    Private Sub mainMenuItemChangeUser_Click(sender As Object, e As EventArgs) Handles mainMenuItemChangeUser.Click
        OpenMenuFunction(NAV_ITEM_CHANGE_USER_SYS_SETUP_TAG) '06

    End Sub

    Private Sub mainMenuItemLedgers_Click(sender As Object, e As EventArgs) Handles mainMenuItemLedgers.Click
        OpenMenuFunction(NAV_ITEM_LEDGERS_SYS_MANAGE_TAG) '01

    End Sub

    Private Sub mainMenuItemUsers_Click(sender As Object, e As EventArgs) Handles mainMenuItemUsers.Click
        OpenMenuFunction(NAV_ITEM_USERS_SYS_MANAGE_TAG) '02

    End Sub

    Private Sub mainMenuItemAcctConvert_Click(sender As Object, e As EventArgs) Handles mainMenuItemAcctConvert.Click
        OpenMenuFunction(NAV_ITEM_ACCT_CONVERT_SYS_MANAGE_TAG) '03

    End Sub

    Private Sub mainMenuItemClearLedger_Click(sender As Object, e As EventArgs) Handles mainMenuItemClearLedger.Click

        OpenMenuFunction(NAV_ITEM_CLEAR_GENERAL_LEDGER_SYS_MANAGE_TAG)
    End Sub

    Private Sub mainMenuItemInitialize_Click(sender As Object, e As EventArgs) Handles mainMenuItemInitialize.Click
        OpenMenuFunction(NAV_ITEM_INITIALIZE_SYS_MANAGE_TAG) '04

    End Sub

    Private Sub mainMenuPrintSetup_Click(sender As Object, e As EventArgs) Handles mainMenuPrintSetup.Click
        OpenMenuFunction(NAV_ITEM_PRINT_SETUP_SYS_SETUP_TAG) '01
    End Sub

    Private Sub mainMenuItemSepcialProject_Click(sender As Object, e As EventArgs) Handles mainMenuItemSepcialProject.Click
        OpenMenuFunction(NAV_ITEM_SPECIAL_PROJECT_FINANCIALSETUP_TAG) '04
    End Sub

    Public Sub SetNotifyText(ByVal s As String)
        Me.tssLblNotify.Text = s
    End Sub

    Public Sub FreshWorkPeriodText()
        Me.tssLblWorkYear.Text = "当前会计期间：" & sysCurrentLedgerSetting.LedgerWorkYear
    End Sub
End Class
